package com.ly.ocw.entity.weixin;

import org.springframework.web.bind.annotation.RequestParam;

import com.google.common.base.Objects;

public class WeixinUserCardStat implements Comparable<WeixinUserCardStat> {

	private String number;// 领卡人数
	private String date;// 日期
	private String year;// 查询条件
	private String cardId;// 查询条件
	private String yearMonth;// 查询条件

	public String getYearMonth() {
		return yearMonth;
	}

	public void setYearMonth(String yearMonth) {
		this.yearMonth = yearMonth;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public WeixinUserCardStat() {
		super();
	}

	public WeixinUserCardStat(String number, String date) {
		super();
		this.number = number;
		this.date = date;
	}

	@Override
	public int compareTo(WeixinUserCardStat o) {
		return this.getDate().compareTo(o.getDate());
	}

	/**
	 * 重载hashCode,只计算date;
	 */
	@Override
	public int hashCode() {
		return Objects.hashCode(this.date);
	}

	/**
	 * 重载equals,只计算date;
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		WeixinUserCardStat other = (WeixinUserCardStat) obj;
		if (this.date == null) {
			if (other.date != null) {
				return false;
			}
		} else if (!this.date.equals(other.date)) {
			return false;
		}
		return true;
	}

}
